package com.yanqu.road.server.cmd.unionwar;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.unionwar.CrossUnionWarProto;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.unionwar.CrossUnionWarMgr;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_CROSS_UNION_WAR_BATTLE_RESULT_SYNC_BACK, desc = "商会战斗结果下发-结果回传")
public class CrossUnionWarBattleResultSyncBackCmd extends CrossUnionCommand {

    private CrossUnionWarProto.CroUnionWarBattleResultBackMsg backMsg;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        backMsg = CrossUnionWarProto.CroUnionWarBattleResultBackMsg.parseFrom(packet.getBytes());
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossUnionWarMgr.updateBattleResultSendResult(serverId, backMsg.getActivityId(), backMsg.getPhase(), backMsg.getSession(), backMsg.getUnionUidList(), backMsg.getGroupId());
    }

    @Override
    public void sendData() {

    }
}
